<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

<atleap:constants className="com.blandware.atleap.webapp.action.core.siteMap.ViewSiteMapAction$MapSection$SectionElement" var="SECTION_ELEMENT_DOCUMENT" scope="page" />

<atleap:message key="core.siteMap.section.element.document" var="documentTitle" />

<c:set var="section" value="${requestScope['SITE_MAP_SECTION_KEY']}" />
<c:set var="indexElement" value="${section.indexElement}" />
<c:if test="${indexElement != null}">
    <c:set var="isDocument" value="${indexElement.type == pageScope.SECTION_ELEMENT_DOCUMENT}" />
    <c:if test="${isDocument}">
        <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['frontendCssTheme']}/document.gif" />" alt="${documentTitle}" title="${documentTitle}" align="absmiddle" />
    </c:if>
	<a href="<atleap:rewriteUrl href="${indexElement.uri}" addLocaleSuffix="${!isDocument}" />"><c:out value="${indexElement.title}" escapeXml="true" /></a>
</c:if>
<ul style="list-style-type: none; margin-top: 0px; padding-top: 0px;">
	<atleap:iterator items="${section.sections}" var="SITE_MAP_SECTION_KEY" scope="request">
		<li>
			<jsp:include page="/WEB-INF/pages/core/siteMap/siteMapSection.jsp" />
		</li>
	</atleap:iterator>
	<atleap:iterator items="${section.elements}" var="element">
    <c:set var="isDocument" value="${element.type == pageScope.SECTION_ELEMENT_DOCUMENT}" />
		<li>
			<c:if test="${isDocument}">
                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['frontendCssTheme']}/document.gif" />" alt="${documentTitle}" title="${documentTitle}" align="absmiddle" />
            </c:if>
			<a href="<atleap:rewriteUrl href="${element.uri}" addLocaleSuffix="${!isDocument}" />"><c:out value="${element.title}" escapeXml="true" /></a>
		</li>
	</atleap:iterator>
</ul>